<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .p1:first-letter {
            background-color: rgb(128, 60, 60);
        }

        .p1::first-line {
            text-decoration: underline;
        }

        .p2::before {
            /* 插入的内容 */
            content: attr(title);
            color: red;
        }

        .p2::after {
            /* 插入图片 */
            content: url(icon.ico);
        }

        .item:first-child {
            color: red;
        }

        .menu li:last-child {
            color: green;
        }

        .wrap section p:first-of-type {
            color: red;
        }

        .wrap :only-child {
            color: greenyellow;
        }

        .wrap h3:only-of-type {
            color: blue;
        }

        /* 第一种用法，指定位置 */
        /* .menu1>li:nth-child(4){
        color: green;
    } */
        /* 选择奇数和偶数odd奇数，evne偶数 */
        /* .menu1>li:nth-child(odd){
        color: red;
    }
    .menu1>li:nth-child(even){
        color: green;
    } */
        /* n从0开始，依次递增，n为整数 */
        /* .menu1>li:nth-child(n+3){
        color: green;
    } */
        /* .menu1>li:nth-child(2n+1){
        color: green;
    } */
        /* .menu1>li:nth-child(3n+1){
        color: green;
    } */
        /* .menu1>li:nth-last-child(n+3){
        color: green;
    } */
        .menu1>li:not(.a) {
            color: red;
        }

        /* html和root是等效的，但是root的优先级要高于html */
        html {
            border: 1px solid red;
        }

        :root {
            border: 1px solid green;
        }

        input:read-write {
            color: pink;
        }

        input:read-only {
            color: plum;
        }

        /* input:disabled+label{
        color: red;
        
    } */
        /* input:checked+label{
        color: red;
    } */
        .li1~li {
            border: 1px solid black
        }

        input:default+label {
            color: red;
        }

        ::selection {
            background-color: rgb(136, 86, 86);
            color: blanchedalmond;

        }

        /*设置滚动条*/
        body::-webkit-scrollbar {
            width: 5px;
        }

        /*设置滚动条拇指元素*/
        body::-webkit-scrollbar-thumb:vertical {
            border-radius: 5px;
            background: #ca1616;
        }

        /*设置滚动条背景元素*/
        body::-webkit-scrollbar-track-piece:vertical {
            border-radius: 5px;
            background: #4da185;
        }

        ::-webkit-input-placeholder {
            color: #769bff;
        }
    </style>
</head>

<body>
    <p class="p1">hello world 天将降大任于斯人也，必先苦其心志，劳其筋骨，饿其体肤，空乏其身，行拂乱其所为也，所以动心忍性，增益其所不能。</p>
    <p class="p2" title="一个段落">百度</p>
    <ul class="menu">
        <li class="item">项目1</li>
        <li class="item">项目2
            <!-- <ul>
                <li>子项目1</li>
                <li>子项目2</li>
                <li>子项目3</li>
            </ul> -->
        </li>
        <li class="item a">项目3</li>
        <li class="item a">项目4</li>
        <li class="item">项目5</li>
        <li class="item">项目6</li>
        <li class="item">项目7</li>
        <li class="item">项目8</li>
    </ul>

    <div class="wrap">
        <section>
            <h3>江山如此多娇，引无数英雄竞折腰。只有一个H3</h3>
            <p>江山如此多娇，引无数英雄竞折腰。</p>
            <p>江山如此多娇，引无数英雄竞折腰。</p>
        </section>
        <hr width="80%" color="red">
        <article>
            <h3>江山如此多娇，引无数英雄竞折腰。</h3>
            <h3>江山如此多娇，引无数英雄竞折腰。</h3>
            <p>江山如此多娇，引无数英雄竞折腰。</p>
            <p>江山如此多娇，引无数英雄竞折腰。</p>
        </article>
        <div>
            <p>独生子</p>
        </div>
    </div>
    <hr>
    <ul class="menu1">
        <li class="item1 li1">项目1</li>
        <li class="item1">项目2
            <!-- <ul>
                <li>子项目1</li>
                <li>子项目2</li>
                <li>子项目3</li>
            </ul> -->
        </li>
        <li class="item1 a">项目3</li>
        <li class="item1 a">项目4</li>
        <li class="item1">项目5</li>
        <li class="item1">项目6</li>
        <li class="item1">项目7</li>
        <li class="item1">项目8</li>
    </ul>
    <input type="text" value="read-write"><br>
    <input type="text " value="read-only" readonly><br>
    <input type="radio" checked>
    <label for="">A</label><br>
    <input type="checkbox" checked>
    <label for="">B</label><br>
    <input type="text" placeholder="你叫啥子名字">
</body>

</html>